package com.ys;



import com.ys.spi.api.Speak;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @描述:
 * @类名:
 * @作者: yangshuang
 * @创建时间: 2017/12/4 20:17
 * @版本: v1.0
 */
public class SPITest {

    public static void main(String[] args) {
        ServiceLoader<Speak> s = ServiceLoader.load(Speak.class);
        Iterator<Speak> searchs = s.iterator();
        if(searchs.hasNext()){
            Speak speak = searchs.next();
            speak.sayHello();
        }
    }
}
